package com.xc.h05.controller.renMengBinController;

import com.github.pagehelper.PageInfo;
import com.xc.h05.entity.ConsultRMB;
import com.xc.h05.service.renMengBinService.ConsultRMBService;
import com.xc.h05.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/consultRMB")
public class ConsultController {
    @Autowired
    private ConsultRMBService consultRMBService;

    //根据id查询（咨询师，证书，等级）
    @GetMapping("/getConsultListById/{id}")
    public R getConsultListById(@PathVariable("id") int id)
    {
        List<ConsultRMB> list = consultRMBService.getConsultListById(id);
        System.out.println("根基id查询咨询师所有信息");
        return R.ok(list);
    }
    //查询所有--咨询师表-等级表-证书表-擅长领域表
    @GetMapping("/getAll")
    public R getAll(
            @RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
            @RequestParam(value = "pageSize", required = false, defaultValue = "20") int pageSize
    ){
        PageInfo<ConsultRMB> pageInfo = consultRMBService.selectAll(pageNum, pageSize);
        return R.ok(pageInfo);
    }

}
